<template>
  <div class="container">
    <Search @search="onSearch" @reset="onReset" @create="onCreate" @setting="onSetting"/>
    <Table :fetch-params="state.search" />
  </div>
</template>

<script setup lang="tsx">
import Search from '@renderer/components/search'
import Table from './components/Table'
import { reactive } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const state = reactive({
  search: {
    Title: '',
    CreatedBetween: [],
    Statue: 0 // 0 全部 1 未开始 2 运行中 3 已暂停 4 已完成
  }
})
const onSearch = (v: any) => {
  state.search = { ...state.search, ...v }
}
const onReset = (v: any) => {
  state.search = { ...state.search, ...v }
}
const onCreate = () => {
  console.log('创建', router)
  router.push('/publishGroupNotice/create')
}
const onSetting = () => {
  router.push('/publishGroupNotice/taskSetting')
}
</script>

<style scoped lang="scss">
.container {
  padding: 10px;
  background: #fff;
}
</style>
